-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Data Views] Disable scripted field creation in the Data Views management page #202250
[Data Views] Disable scripted field creation in the Data Views management page #202250
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Markdown support for UA deprecations LGTM. Great addition!
@davismcphee Thank you for updating the docs 😄 @florent-leborgne is on paternity leave, so I'm reviewing this instead. All docs changes LGTM! Just suggesting some small changes for clarity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test/tsconfig.json
changes LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UA changes lgtm, left one small question
const textContent = | ||
typeof currentMessage === 'string' ? currentMessage : currentMessage.content; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that we might run into issues if currentMessage.content
doesn't exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be ok because the only valid types are string
or { type: 'text' | 'markdown'; content: string; }
, and we account for each. Someone could do an unsafe cast when registering their deprecation, but that's true for most TS code.
numberOfDataViewsWithScriptedFields: dataViewsWithScriptedFields.length, | ||
runtimeFieldsLink: docLinks.indexPatterns.runtimeFields, | ||
esqlLink: docLinks.query.queryESQL, | ||
dataViewsList: dataViewsWithScriptedFields.map(buildDataViewsListEntry).join('\n'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great, tested and works as expected, no scripted fields in a data view, no tab, just the manual way using the old URL to create a scripted field, which then shows the tab with scripted fields, and no button 🥳
One question, about the deprecation message, previously we showed just a max of 3 data views, but it seems we show them all now? or do I miss something. ... just for the case when there are many data views with scripted fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to only show up to three titles in the message, but included the full list in the corrective actions:
kibana/src/plugins/data_views/server/deprecations/scripted_fields.ts
Lines 64 to 72 in cdb5a2d
i18n.translate('dataViews.deprecations.scriptedFields.manualStepTwoMessage', { | |
defaultMessage: | |
'Update {numberOfIndexPatternsWithScriptedFields} data views that have scripted fields to use runtime fields instead. In most cases, to migrate existing scripts, you will need to change "return <value>;" to "emit(<value>);". Data views with at least one scripted field: {allTitles}', | |
values: { | |
allTitles: indexPatternTitles.join('; '), | |
numberOfIndexPatternsWithScriptedFields: indexPatternsWithScriptedFields.length, | |
}, | |
ignoreTag: true, | |
}), |
I removed the ones from correctiveActions
and instead put a formatted list in the main message. This could get really long for customers who have many data views with scripted fields, but the alternative is not having access to a full list, so I'm not sure what else we could do here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's how it works, thx, what else we can do? Nothing. Approving 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wajihaparvez Thanks for the review and heads up about @florent-leborgne! Applied all of your feedback here: 8334e46.
const textContent = | ||
typeof currentMessage === 'string' ? currentMessage : currentMessage.content; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be ok because the only valid types are string
or { type: 'text' | 'markdown'; content: string; }
, and we account for each. Someone could do an unsafe cast when registering their deprecation, but that's true for most TS code.
numberOfDataViewsWithScriptedFields: dataViewsWithScriptedFields.length, | ||
runtimeFieldsLink: docLinks.indexPatterns.runtimeFields, | ||
esqlLink: docLinks.query.queryESQL, | ||
dataViewsList: dataViewsWithScriptedFields.map(buildDataViewsListEntry).join('\n'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to only show up to three titles in the message, but included the full list in the corrective actions:
kibana/src/plugins/data_views/server/deprecations/scripted_fields.ts
Lines 64 to 72 in cdb5a2d
i18n.translate('dataViews.deprecations.scriptedFields.manualStepTwoMessage', { | |
defaultMessage: | |
'Update {numberOfIndexPatternsWithScriptedFields} data views that have scripted fields to use runtime fields instead. In most cases, to migrate existing scripts, you will need to change "return <value>;" to "emit(<value>);". Data views with at least one scripted field: {allTitles}', | |
values: { | |
allTitles: indexPatternTitles.join('; '), | |
numberOfIndexPatternsWithScriptedFields: indexPatternsWithScriptedFields.length, | |
}, | |
ignoreTag: true, | |
}), |
I removed the ones from correctiveActions
and instead put a formatted list in the main message. This could get really long for customers who have many data views with scripted fields, but the alternative is not having access to a full list, so I'm not sure what else we could do here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tested and works as expected, no scripted fields in a data view, no tab, just the manual way using the old URL to create a scripted field, which then shows the tab with scripted fields, and no button. thx for moving scripted fields another step into there well deserved retirement 🦕
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
History
cc @davismcphee |
…ment page (elastic#202250) ## Summary Scripted fields in data views have been deprecated since 7.13, and superseded by runtime fields. The ability to create new scripted fields has been removed from the Data Views management page in 9.0. Existing scripted fields can still be edited or deleted, and the creation UI can be accessed by navigating directly to `/app/management/kibana/dataViews/dataView/{dataViewId}/create-field`, but it is recommended to migrate to runtime fields or ES|QL instead to prepare for removal. Additionally, the scripted fields entry in the Upgrade Assistant has been updated to reflect these changes, improve migration instructions, and surface the full list of data views across all spaces that contain scripted fields as well as their associated spaces. New documentation has been added to the "Manage data views" page with examples and instructions to help users migrate off scripted fields to runtime fields or ES|QL, which is also linked to from the Upgrade Assistant entry. Data Views management page: ![management](https://github.com/user-attachments/assets/ed42310c-d7fa-48ba-8430-533e9230b48d) Upgrade Assistant: <img src="https://github.com/user-attachments/assets/4ff27866-4fe8-4357-82e8-cd4c503ab50b" width="500" /> Resolves elastic#182067. ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Matt Kime <[email protected]> Co-authored-by: kibanamachine <[email protected]>
…ment page (elastic#202250) ## Summary Scripted fields in data views have been deprecated since 7.13, and superseded by runtime fields. The ability to create new scripted fields has been removed from the Data Views management page in 9.0. Existing scripted fields can still be edited or deleted, and the creation UI can be accessed by navigating directly to `/app/management/kibana/dataViews/dataView/{dataViewId}/create-field`, but it is recommended to migrate to runtime fields or ES|QL instead to prepare for removal. Additionally, the scripted fields entry in the Upgrade Assistant has been updated to reflect these changes, improve migration instructions, and surface the full list of data views across all spaces that contain scripted fields as well as their associated spaces. New documentation has been added to the "Manage data views" page with examples and instructions to help users migrate off scripted fields to runtime fields or ES|QL, which is also linked to from the Upgrade Assistant entry. Data Views management page: ![management](https://github.com/user-attachments/assets/ed42310c-d7fa-48ba-8430-533e9230b48d) Upgrade Assistant: <img src="https://github.com/user-attachments/assets/4ff27866-4fe8-4357-82e8-cd4c503ab50b" width="500" /> Resolves elastic#182067. ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Matt Kime <[email protected]> Co-authored-by: kibanamachine <[email protected]>
…ment page (elastic#202250) ## Summary Scripted fields in data views have been deprecated since 7.13, and superseded by runtime fields. The ability to create new scripted fields has been removed from the Data Views management page in 9.0. Existing scripted fields can still be edited or deleted, and the creation UI can be accessed by navigating directly to `/app/management/kibana/dataViews/dataView/{dataViewId}/create-field`, but it is recommended to migrate to runtime fields or ES|QL instead to prepare for removal. Additionally, the scripted fields entry in the Upgrade Assistant has been updated to reflect these changes, improve migration instructions, and surface the full list of data views across all spaces that contain scripted fields as well as their associated spaces. New documentation has been added to the "Manage data views" page with examples and instructions to help users migrate off scripted fields to runtime fields or ES|QL, which is also linked to from the Upgrade Assistant entry. Data Views management page: ![management](https://github.com/user-attachments/assets/ed42310c-d7fa-48ba-8430-533e9230b48d) Upgrade Assistant: <img src="https://github.com/user-attachments/assets/4ff27866-4fe8-4357-82e8-cd4c503ab50b" width="500" /> Resolves elastic#182067. ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Matt Kime <[email protected]> Co-authored-by: kibanamachine <[email protected]>
…ment page (elastic#202250) ## Summary Scripted fields in data views have been deprecated since 7.13, and superseded by runtime fields. The ability to create new scripted fields has been removed from the Data Views management page in 9.0. Existing scripted fields can still be edited or deleted, and the creation UI can be accessed by navigating directly to `/app/management/kibana/dataViews/dataView/{dataViewId}/create-field`, but it is recommended to migrate to runtime fields or ES|QL instead to prepare for removal. Additionally, the scripted fields entry in the Upgrade Assistant has been updated to reflect these changes, improve migration instructions, and surface the full list of data views across all spaces that contain scripted fields as well as their associated spaces. New documentation has been added to the "Manage data views" page with examples and instructions to help users migrate off scripted fields to runtime fields or ES|QL, which is also linked to from the Upgrade Assistant entry. Data Views management page: ![management](https://github.com/user-attachments/assets/ed42310c-d7fa-48ba-8430-533e9230b48d) Upgrade Assistant: <img src="https://github.com/user-attachments/assets/4ff27866-4fe8-4357-82e8-cd4c503ab50b" width="500" /> Resolves elastic#182067. ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Matt Kime <[email protected]> Co-authored-by: kibanamachine <[email protected]>
…ment page (elastic#202250) ## Summary Scripted fields in data views have been deprecated since 7.13, and superseded by runtime fields. The ability to create new scripted fields has been removed from the Data Views management page in 9.0. Existing scripted fields can still be edited or deleted, and the creation UI can be accessed by navigating directly to `/app/management/kibana/dataViews/dataView/{dataViewId}/create-field`, but it is recommended to migrate to runtime fields or ES|QL instead to prepare for removal. Additionally, the scripted fields entry in the Upgrade Assistant has been updated to reflect these changes, improve migration instructions, and surface the full list of data views across all spaces that contain scripted fields as well as their associated spaces. New documentation has been added to the "Manage data views" page with examples and instructions to help users migrate off scripted fields to runtime fields or ES|QL, which is also linked to from the Upgrade Assistant entry. Data Views management page: ![management](https://github.com/user-attachments/assets/ed42310c-d7fa-48ba-8430-533e9230b48d) Upgrade Assistant: <img src="https://github.com/user-attachments/assets/4ff27866-4fe8-4357-82e8-cd4c503ab50b" width="500" /> Resolves elastic#182067. ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Matt Kime <[email protected]> Co-authored-by: kibanamachine <[email protected]>
…ment page (elastic#202250) ## Summary Scripted fields in data views have been deprecated since 7.13, and superseded by runtime fields. The ability to create new scripted fields has been removed from the Data Views management page in 9.0. Existing scripted fields can still be edited or deleted, and the creation UI can be accessed by navigating directly to `/app/management/kibana/dataViews/dataView/{dataViewId}/create-field`, but it is recommended to migrate to runtime fields or ES|QL instead to prepare for removal. Additionally, the scripted fields entry in the Upgrade Assistant has been updated to reflect these changes, improve migration instructions, and surface the full list of data views across all spaces that contain scripted fields as well as their associated spaces. New documentation has been added to the "Manage data views" page with examples and instructions to help users migrate off scripted fields to runtime fields or ES|QL, which is also linked to from the Upgrade Assistant entry. Data Views management page: ![management](https://github.com/user-attachments/assets/ed42310c-d7fa-48ba-8430-533e9230b48d) Upgrade Assistant: <img src="https://github.com/user-attachments/assets/4ff27866-4fe8-4357-82e8-cd4c503ab50b" width="500" /> Resolves elastic#182067. ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Matt Kime <[email protected]> Co-authored-by: kibanamachine <[email protected]>
…ment page (elastic#202250) ## Summary Scripted fields in data views have been deprecated since 7.13, and superseded by runtime fields. The ability to create new scripted fields has been removed from the Data Views management page in 9.0. Existing scripted fields can still be edited or deleted, and the creation UI can be accessed by navigating directly to `/app/management/kibana/dataViews/dataView/{dataViewId}/create-field`, but it is recommended to migrate to runtime fields or ES|QL instead to prepare for removal. Additionally, the scripted fields entry in the Upgrade Assistant has been updated to reflect these changes, improve migration instructions, and surface the full list of data views across all spaces that contain scripted fields as well as their associated spaces. New documentation has been added to the "Manage data views" page with examples and instructions to help users migrate off scripted fields to runtime fields or ES|QL, which is also linked to from the Upgrade Assistant entry. Data Views management page: ![management](https://github.com/user-attachments/assets/ed42310c-d7fa-48ba-8430-533e9230b48d) Upgrade Assistant: <img src="https://github.com/user-attachments/assets/4ff27866-4fe8-4357-82e8-cd4c503ab50b" width="500" /> Resolves elastic#182067. ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Matt Kime <[email protected]> Co-authored-by: kibanamachine <[email protected]>
Summary
Scripted fields in data views have been deprecated since 7.13, and superseded by runtime fields.
The ability to create new scripted fields has been removed from the Data Views management page in 9.0. Existing scripted fields can still be edited or deleted, and the creation UI can be accessed by navigating directly to
/app/management/kibana/dataViews/dataView/{dataViewId}/create-field
, but it is recommended to migrate to runtime fields or ES|QL instead to prepare for removal.Additionally, the scripted fields entry in the Upgrade Assistant has been updated to reflect these changes, improve migration instructions, and surface the full list of data views across all spaces that contain scripted fields as well as their associated spaces. New documentation has been added to the "Manage data views" page with examples and instructions to help users migrate off scripted fields to runtime fields or ES|QL, which is also linked to from the Upgrade Assistant entry.
Data Views management page:
Upgrade Assistant:
Resolves #182067.
Checklist
release_note:breaking
label should be applied in these situations.release_note:*
label is applied per the guidelines